package com.shenjies88.practice.reactor;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

/**
 * @author shenjies88
 * @since 2022/12/7/20:14
 */
public class Client {
    public static void main(String[] args) throws IOException, InterruptedException {
        int size = 1000;
        for (int i = 0; i < size; i++) {
            var socketChannel = SocketChannel.open();
            socketChannel.connect(new InetSocketAddress("127.0.0.1", 8080));
            socketChannel.write(ByteBuffer.wrap(("消息_" + i).getBytes()));
        }
        Thread.sleep(1000 * 60 * 60);
    }
}
